The invention relates to a digitally controlled oscillator and the application thereof in a sonar transmitter/receiver for compensating the frequency error in the sonar-detected target return signals, which error is due to the doppler shift through the motion of the sonar transmitter and receiver. Since the doppler shift follows a cosine function with respect to the direction of motion of the sonar transmitter/receiver, this frequency error differs for the various sonar receiver channels.